The present disclosure generally relates to computer systems, and more specifically, to supporting big-endian (BE) and little-endian (LE) computing environments.
A computer system may implement a BE or a LE architecture. In a BE system, the most significant byte of an element in storage is stored in the smallest address in the element's memory location, and the least significant byte is stored in the largest address. In a LE system, the least significant byte of the element is stored in the smallest address in the element's memory location, and the most significant byte is stored in the largest address. For example, Intel™ systems are LE systems, while IBM z/Architecture™ systems are BE systems. Complexity is introduced with the emergence of vector processing where a single vector storage access involves a plurality of values.
Computing systems employ a byte ordering scheme and a vector element ordering (VEO) scheme. For byte ordering, a word consists of X number of bytes. A convention is used to determine whether BE or LE is used. Another convention is needed for the order of elements if we have multiple elements, such as with vectors. This convention could be the same or different than the data byte ordering. Often it is desirable to make these the same, but it may be better if they are opposite in some situations. For example, legacy systems may use a different VEO scheme than newer systems. Also, applications and code may be written for an architecture that uses one or the other VEO. It can be an expensive, long, and difficult process to rewrite code to match the architecture of the system on which it is being executed.